package com.SunSoft.PhoneRemoteControl;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import org.apache.http.message.BasicNameValuePair;

final class r extends Handler
{
  public final void handleMessage(Message paramMessage)
  {
    super.handleMessage(paramMessage);
    switch (paramMessage.what)
    {
    case 8:
    case 18:
    default:
    case 10:
    case 7:
    case 11:
    case 12:
    case 6:
    case 9:
    case 5:
    case 1:
    case 2:
    case 3:
    case 4:
    case 16:
    case 20:
    case 21:
    case 13:
    case 14:
    case 15:
    case 24:
    case 19:
    case 17:
    case 23:
    case 26:
    case 22:
    case 25:
      do
      {
        do
        {
          do
          {
            do
            {
              return;
              this.a.bi = 0;
              new Thread(MainControl.j(this.a)).start();
              return;
              paramMessage = new Intent();
              paramMessage.setClass(this.a.getApplicationContext(), MyViewPagerActivity.class);
              paramMessage.putExtra("type_id", 1);
              this.a.startActivity(paramMessage);
              return;
              if (MainControl.d(this.a).a("has_new_soft").equals("YES"))
              {
                this.a.aQ.setText(2131099816);
                this.a.aQ.setTextColor(-65536);
              }
              while (MainControl.d(this.a).a("has_new_data").equals("YES"))
              {
                this.a.aP.setText(2131099816);
                this.a.aP.setTextColor(-65536);
                return;
                this.a.aQ.setText("V" + MainControl.k(this.a));
                this.a.aQ.setTextColor(-16777216);
              }
              paramMessage = MainControl.d(this.a).a("db_v");
              this.a.c = Integer.valueOf(paramMessage).intValue();
              this.a.aP.setText("V" + String.valueOf(this.a.c));
              this.a.aP.setTextColor(-16777216);
              return;
              new Thread(MainControl.j(this.a)).start();
              return;
              if (this.a.bf != null)
                if (this.a.bi == 0)
                  this.a.c(this.a.bf);
              while (true)
              {
                this.a.aZ = false;
                return;
                this.a.R = new fy(this.a);
                this.a.R.a(this.a.bi, this.a.bf);
                continue;
                if (this.a.bi == 0)
                  continue;
                Toast.makeText(this.a, this.a.getString(2131099675), 0).show();
              }
              Toast.makeText(this.a, this.a.bh, 0).show();
              return;
              Toast.makeText(this.a, this.a.getString(2131099768), 0).show();
              new Thread(MainControl.l(this.a)).start();
              return;
              if (this.a.bc.equals("0"))
                this.a.bc = this.a.getString(2131099770);
              if (this.a.bc.startsWith("1"))
              {
                this.a.bd = this.a.bc;
                MainControl.d(this.a).a("save_user", this.a.aX);
                MainControl.d(this.a).a("save_pass", this.a.aY);
                MainControl.d(this.a).a("save_info", this.a.bd);
                MainControl.a("Test", "user_info:" + this.a.bd);
                this.a.bc = this.a.getString(2131099775);
                this.a.aV = true;
                this.a.a(3);
              }
              while (true)
              {
                if (this.a.bc.equals("2"))
                  this.a.bc = this.a.getString(2131099776);
                if (this.a.bc.equals("3"))
                  this.a.bc = this.a.getString(2131099769);
                Toast.makeText(this.a, this.a.bc, 1).show();
                MainControl.a("Test", "retrun_str:" + this.a.bc);
                this.a.aZ = false;
                return;
                this.a.aV = false;
              }
              if (this.a.bc.equals("0"))
                this.a.bc = this.a.getString(2131099770);
              if (this.a.bc.startsWith("1"))
              {
                MainControl.d(this.a).a("save_user", this.a.aX);
                MainControl.d(this.a).a("save_pass", this.a.aY);
                MainControl.d(this.a).a("save_info", "");
                this.a.bc = this.a.getString(2131099777);
                this.a.aV = true;
                this.a.a(3);
                this.a.ai.setText(this.a.aX + this.a.getString(2131099821));
              }
              if (this.a.bc.equals("2"))
                this.a.bc = this.a.getString(2131099778);
              if (this.a.bc.equals("3"))
                this.a.bc = this.a.getString(2131099769);
              Toast.makeText(this.a, this.a.bc, 1).show();
              MainControl.a("Test", "retrun_str:" + this.a.bc);
              this.a.aZ = false;
              return;
              if (this.a.bc.equals("0"))
                this.a.bc = this.a.getString(2131099770);
              if (this.a.bc.startsWith("1"))
              {
                MainControl.d(this.a).a("save_pass", "");
                this.a.bc = this.a.getString(2131099781);
                this.a.aV = false;
                this.a.a(4);
              }
              if (this.a.bc.equals("2"))
              {
                this.a.bc = this.a.getString(2131099782);
                this.a.aV = false;
                this.a.a(4);
              }
              if (this.a.bc.equals("3"))
                this.a.bc = this.a.getString(2131099769);
              Toast.makeText(this.a, this.a.bc, 1).show();
              MainControl.a("Test", "retrun_str:" + this.a.bc);
              this.a.aZ = false;
              return;
              if (this.a.bc.equals("0"))
                this.a.bc = this.a.getString(2131099770);
              if (this.a.bc.startsWith("1"))
              {
                this.a.bd = this.a.be;
                MainControl.d(this.a).a("save_info", this.a.bd);
                this.a.bc = this.a.getString(2131099779);
              }
              if (this.a.bc.equals("2"))
              {
                this.a.bc = this.a.getString(2131099780);
                this.a.aV = false;
                this.a.a(4);
              }
              if (this.a.bc.equals("3"))
                this.a.bc = this.a.getString(2131099769);
              Toast.makeText(this.a, this.a.bc, 1).show();
              MainControl.a("Test", "retrun_str:" + this.a.bc);
              this.a.aZ = false;
              return;
              if (this.a.bc.equals("0"))
                this.a.bc = this.a.getString(2131099770);
              if (this.a.bc.startsWith("1"))
              {
                this.a.bw = this.a.bc.substring(3);
                MainControl.a("Test", "get_feedback_info:" + this.a.bw);
                MainControl.d(this.a).a("feedback_info", this.a.bw);
                this.a.bc = this.a.getString(2131099956);
                this.a.bs = false;
                this.a.bt = false;
              }
              if (this.a.bc.startsWith("2"))
              {
                this.a.bc = this.a.getString(2131099957);
                this.a.h();
              }
              if (this.a.bc.equals("3"))
                this.a.bc = this.a.getString(2131099769);
              Toast.makeText(this.a, this.a.bc, 1).show();
              MainControl.a("Test", "retrun_str:" + this.a.bc);
              this.a.aZ = false;
              return;
            }
            while ((!(this.a.bs)) || (this.a.bt));
            Toast.makeText(this.a, this.a.getString(2131099955), 0).show();
            this.a.aR.setText(2131099954);
            this.a.aR.setTextColor(-65536);
            return;
            this.a.an = new ArrayList();
            this.a.an.add(new BasicNameValuePair("txtUser_name", this.a.aj));
            this.a.an.add(new BasicNameValuePair("txtPassword", this.a.ak));
            this.a.an.add(new BasicNameValuePair("control_data_value", ""));
            this.a.an.add(new BasicNameValuePair("action_value", "read"));
            this.a.aZ = true;
            this.a.bb = "http://www.tasogo.com/user_msg.aspx";
            this.a.bc = dg.a(this.a.bb, this.a.an);
            this.a.aZ = false;
            MainControl.a("Test", "retrun_str:" + this.a.bc);
          }
          while (!(this.a.bc.startsWith("1||1||")));
          MainControl.a("Test", "set feedback read");
          this.a.bw = this.a.bc.substring(3);
          MainControl.a("Test", "get_feedback_info:" + this.a.bw);
          MainControl.d(this.a).a("feedback_info", this.a.bw);
          if ((this.a.bw != null) && (!(this.a.bw.equals(""))))
          {
            paramMessage = this.a.bw.split("\\|\\|");
            if (paramMessage.length > 6)
            {
              this.a.bs = paramMessage[6].equals("1");
              this.a.bt = paramMessage[9].equals("1");
              this.a.bv = paramMessage[5] + "||" + paramMessage[2] + "||" + paramMessage[3];
              if ((this.a.bs) && (!(this.a.bt)))
              {
                this.a.aR.setText(2131099954);
                this.a.aR.setTextColor(-65536);
              }
            }
          }
          this.a.aR.setText(2131099833);
          this.a.aR.setTextColor(-16777216);
          return;
          this.a.aZ = false;
          if (this.a.bc.equals("0"))
            this.a.bc = this.a.getString(2131099770);
          if (this.a.bc.startsWith("1||"))
          {
            paramMessage = this.a.bc.split("\\|\\|");
            if (paramMessage.length >= 4)
            {
              this.a.bk = Integer.valueOf(paramMessage[1]).intValue();
              MainControl.a("Test", "sum_data_count:" + this.a.bk);
              this.a.bn = paramMessage[2].split("##");
              MainControl.a("Test", "save_id_list:" + this.a.bn.length);
              if (this.a.bj != 14)
                break label2943;
              if (this.a.bk <= 0)
                break label2890;
              if (this.a.bk > 30)
                this.a.bk = 30;
              paramMessage = this.a.getString(2131099783) + this.a.getString(2131099784) + paramMessage[3] + this.a.getString(2131099785) + paramMessage[1] + "\n" + this.a.getString(2131099786) + String.valueOf(this.a.bm) + this.a.getString(2131099788);
              new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setNegativeButton(this.a.getString(2131099654), new s(this)).setPositiveButton(this.a.getString(2131099653), new x(this)).show();
            }
          }
          while (true)
          {
            while (true)
            {
              MainControl.a("Test", "retrun_str1:" + this.a.bc);
              return;
              paramMessage = this.a.getString(2131099786) + String.valueOf(this.a.bm) + this.a.getString(2131099787);
            }
            if (this.a.bj == 15)
            {
              if (this.a.bk > 0)
              {
                paramMessage = this.a.getString(2131099783) + this.a.getString(2131099784) + paramMessage[3] + this.a.getString(2131099785) + paramMessage[1] + this.a.getString(2131099790);
                new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setNegativeButton(this.a.getString(2131099654), new y(this)).setPositiveButton(this.a.getString(2131099653), new z(this)).show();
              }
              paramMessage = this.a.getString(2131099792);
              new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setNegativeButton(this.a.getString(2131099654), new aa(this)).show();
            }
            if (this.a.bj != 19)
              continue;
            if (this.a.bk > 0)
            {
              paramMessage = this.a.getString(2131099848) + paramMessage[1] + "\n" + this.a.getString(2131099849) + paramMessage[3] + "\n" + this.a.getString(2131099850);
              new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setNegativeButton(this.a.getString(2131099654), new ab(this)).setPositiveButton(this.a.getString(2131099653), new ac(this)).show();
            }
            paramMessage = this.a.getString(2131099851);
            new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setNegativeButton(this.a.getString(2131099654), new ad(this)).show();
            continue;
            if (this.a.bc.equals("2"))
            {
              this.a.bc = this.a.getString(2131099780);
              this.a.aV = false;
              this.a.a(4);
            }
            if (this.a.bc.equals("3"))
              this.a.bc = this.a.getString(2131099769);
            Toast.makeText(this.a, this.a.bc, 1).show();
          }
          this.a.aZ = false;
          if (this.a.bm == this.a.bl);
          for (paramMessage = this.a.getString(2131099796) + this.a.bm; ; paramMessage = this.a.getString(2131099797) + this.a.bm + this.a.getString(2131099795) + this.a.bl)
          {
            new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setPositiveButton(this.a.getString(2131099653), new ae(this)).show();
            return;
          }
          this.a.aZ = false;
          if (this.a.bk == this.a.bl);
          for (paramMessage = this.a.getString(2131099793) + this.a.bk; ; paramMessage = this.a.getString(2131099794) + this.a.bk + this.a.getString(2131099795) + this.a.bl)
          {
            new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setPositiveButton(this.a.getString(2131099653), new t(this)).show();
            this.a.y = 1;
            this.a.a();
            return;
          }
          this.a.aZ = false;
          if (this.a.bm == this.a.bl);
          for (paramMessage = "已经成功上传,可通知用户下载测试," + this.a.bm; ; paramMessage = this.a.getString(2131099797) + this.a.bm + this.a.getString(2131099795) + this.a.bl)
          {
            new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setPositiveButton(this.a.getString(2131099653), new u(this)).show();
            return;
          }
          this.a.aZ = false;
          if (this.a.bk == this.a.bl);
          for (paramMessage = this.a.getString(2131099853); ; paramMessage = this.a.getString(2131099854))
          {
            new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramMessage).setPositiveButton(this.a.getString(2131099653), new v(this)).show();
            this.a.b();
            this.a.y = 1;
            this.a.a();
            return;
          }
          if ((((!(MyApplication.a().a)) || (!(MyApplication.a().b)) || (this.a.bH != 0))) && (this.a.bH != 1))
          {
            MainControl.a(this.a, ProgressDialog.show(this.a, MainControl.g(this.a), this.a.getString(2131099855)));
            new Timer().schedule(new cu(this.a), 2000L);
          }
          MainControl.a(this.a, this.a.bD);
          return;
          if (((MyApplication.a().a) && (MyApplication.a().b) && (this.a.bH == 0)) || (this.a.bH == 1))
          {
            MainControl.b(this.a, this.a.bD);
            return;
          }
          MainControl.c(this.a, this.a.bD);
          return;
          paramMessage = new AlertDialog.Builder(MainControl.j());
          paramMessage.setTitle(MainControl.g(this.a));
          View localView = LayoutInflater.from(MainControl.j()).inflate(2130903061, null);
          this.a.bE = ((ProgressBar)localView.findViewById(2131165237));
          paramMessage.setView(localView);
          paramMessage.setOnKeyListener(new w(this));
          this.a.bF = 0;
          this.a.bE.setProgress(this.a.bF);
          MainControl.a(this.a, paramMessage.create());
          MainControl.m(this.a).show();
          this.a.bX = 0;
          new Timer().schedule(new cz(this.a), this.a.bW * 22, this.a.bW * 22);
          new Timer().schedule(new cx(this.a), 5L, 2200L);
          return;
          MainControl.a(this.a, ProgressDialog.show(this.a, MainControl.g(this.a), this.a.getString(2131099862)));
          MainControl.a(this.a, "FF", 0);
          new Timer().schedule(new cu(this.a), 1500L);
          return;
        }
        while (this.a.aU == null);
        this.a.aU.dismiss();
        this.a.aU = null;
      }
      while (!(this.a.L));
      this.a.e();
      return;
    case 27:
      if (MyApplication.a().a)
      {
        label2890: label2943: this.a.aN.setImageResource(2130837635);
        return;
      }
      if ((!(MyApplication.a().e)) && (MyApplication.a().c))
      {
        this.a.aN.setImageResource(2130837634);
        return;
      }
      this.a.aN.setImageResource(2130837633);
      return;
    case 28:
    }
    MainControl.b(this.a, ProgressDialog.show(this.a, MainControl.g(this.a), this.a.getString(2131099907)));
    new Timer().schedule(new cv(this.a), 2500L);
  }
}